package com.lys.dao;

import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.cfg.AnnotationConfiguration;
import org.hibernate.cfg.Configuration;
import org.hibernate.tool.hbm2ddl.SchemaExport;

/**
 * Data access object (DAO) for domain model
 * @author MyEclipse Persistence Tools
 */
public class BaseHibernateDAO implements IBaseHibernateDAO {
	
	@Override
	public Session getSession() {
		return HibernateSessionFactory.getSession();
	}
	
	public static void main(String[] args) {
		Configuration cfg = new AnnotationConfiguration();
		cfg.configure("/hibernate.cfg.xml");
		SchemaExport schemaExport=new SchemaExport(cfg);   
        schemaExport.create(true, true);
	}
}